import random

random_num = random.randint(1, 10)

user_num = int(input("请输入一个数字："))

if user_num == random_num:
    print("恭喜你，猜对了")
else:
    if user_num > random_num:
        print("你猜的数字太大了")
    else:
        print("你猜的数字太小了")

    user_num = int(input("请第二次输入一个数字："))        

    if user_num == random_num:
        print("恭喜你，猜对了")
    else:
        if user_num > random_num:
            print("你猜的数字太大了")
        else:
            print("你猜的数字太小了")

        user_num = int(input("请第三次输入一个数字："))
        if user_num == random_num:
            print("恭喜你，猜对了")
        else:
            print("你猜的数字都猜错了,正确数字是：%d" % random_num)        